cmake_minimum_required(VERSION 3.0.2)
project(sfbd_udp)

add_definitions(-std=c++11)
add_definitions(-DAPI_EXPORTS)

set(CMAKE_BUILD_TYPE Debug)

file(GLOB_RECURSE Udp_FILES lib/Udp/*.hpp lib/Udp/*.cpp)
file(GLOB_RECURSE Quadrotor_FILES lib/Quadrotor/*.hpp lib/Quadrotor/*.cpp)

find_package(catkin REQUIRED COMPONENTS
        message_generation
        roscpp
        rospy
        std_msgs
        geometry_msgs
        mavros
)

find_package(PCL 1.7 REQUIRED)
find_package(octomap REQUIRED)

catkin_package(
        INCLUDE_DIRS lib/Udp  # 确保包含正确的头文件路径
        INCLUDE_DIRS lib/Quadrotor  # 确保包含正确的头文件路径
)

include_directories(
        lib/Udp  # 确保包含正确的头文件路径
        lib/Quadrotor
        ${catkin_INCLUDE_DIRS}
        ${PCL_INCLUDE_DIRS}
)

link_directories(${PCL_LIBRARY_DIRS})

add_library(udp ${Udp_FILES})
add_library(quadrotor ${Quadrotor_FILES})


#src
add_executable(pub src/pub.cpp ${Udp_FILES} ${Quadrotor_FILES})
add_executable(sub src/sub.cpp ${Udp_FILES} ${Quadrotor_FILES})

target_link_libraries(pub ${catkin_LIBRARIES} unionsys_core)
target_link_libraries(sub ${catkin_LIBRARIES} unionsys_core)